package com.xinhe.web.vo;

import com.xinhe.web.entity.Menu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;
@ApiModel(description = "菜单查询视图")
public class MenuTreeView{
    @ApiModelProperty("主键")
    private Long id;
    @ApiModelProperty("路由名")
    private String routerName;
    @ApiModelProperty("菜单图标")
    private String icon;
    @ApiModelProperty("在侧边栏显示的菜单标题")
    private String title;
    @ApiModelProperty("菜单排序")
    private Integer sequence;
    @ApiModelProperty("vue组件路径")
    private String component;
    @ApiModelProperty("类型（菜单或者操作按钮）")
    private Integer type;
    @ApiModelProperty("进入路由时携带的参数")
    private String params;
    @ApiModelProperty("地址(http/https)开头表示外链路由")
    private String path;
    @ApiModelProperty("父id")
    private Long fParentId;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("下级菜单")
    private List<MenuTreeView> children;

    public MenuTreeView() {}

    public MenuTreeView(Menu menu) {
        BeanUtils.copyProperties(menu, this);
    }
    public void addChild(MenuTreeView menu) {
        if (null == this.children) {
            this.children = new ArrayList<>();
        }
        this.children.add(menu);
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getRouterName() {
        return this.routerName;
    }
    public void setRouterName(String routerName) {
        this.routerName = routerName;
    }
    public String getIcon() {
        return this.icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
    public String getTitle() {
        return this.title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public Integer getSequence() {
        return this.sequence;
    }
    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }
    public String getComponent() {
        return this.component;
    }
    public void setComponent(String component) {
        this.component = component;
    }
    public Integer getType() {
        return this.type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getParams() {
        return this.params;
    }
    public void setParams(String params) {
        this.params = params;
    }
    public String getPath() {
        return this.path;
    }
    public void setPath(String path) {
        this.path = path;
    }

    public Long getfParentId() {
        return fParentId;
    }

    public void setfParentId(Long fParentId) {
        this.fParentId = fParentId;
    }

    public String getRemark() {
        return this.remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public List<MenuTreeView> getChildren() {
        return this.children;
    }
    public void setChildren(List<MenuTreeView> children) {
        this.children = children;
    }
}